<template>
	<BaseContainer>
		<el-tabs tab-position="left" v-model="activeName">
			<el-tab-pane v-for="(item, index) in tabsList" :key="index" :label="item.label" :name="item.value"></el-tab-pane>
			<aplid-base-crud
				:key="activeName"
				ref="crud"
				class="w-100"
				v-bind="activeItem.baseConfig"
				:paramsObj="activeItem.paramsObj ? activeItem.paramsObj : activeItem.baseConfig.paramsObj"
			>
				<template v-slot:pageName></template>
			</aplid-base-crud>
		</el-tabs>
	</BaseContainer>
</template>

<script setup>
import { baseConfig as PolicyDocuments } from '../common/dpWorkPlan'
import { baseConfig as BottoOut } from './BottoOut'
import { baseConfig as RegSet } from './RegSet'
import { baseConfig as TrainLog } from './TrainLog'
import { baseConfig as TargetValue } from '../elderlyReform/TargetValue'

const activeName = ref(1)
const tabsList = [
	{
		label: '工作方案',
		value: 1,
		baseConfig: PolicyDocuments,
		paramsObj: {
			type: 1,
			typeLabel: '2024年开展失能老年人家庭成员照护培训工作方案（区）',
		},
	},
	{
		label: '报名设置',
		value: 2,
		baseConfig: RegSet,
		paramsObj: {
			contentType: '1',
			contentTypeLabel: '开展失能老年人家庭成员照护培训',
		},
	},
	// {
	// 	label: '摸底名单',
	// 	value: 3,
	// 	baseConfig: BottoOut,
	// 	paramsObj: {
	// 		bottomingNeeds: 2,
	// 		bottomingNeedsLabel: '失能老年人家庭成员照护培训',
	// 	},
	// },
	{ label: '培训记录', value: 4, baseConfig: TrainLog },
	// {
	// 	label: '目标值',
	// 	value: 5,
	// 	baseConfig: TargetValue,
	// 	paramsObj: {
	// 		contentType: '3',
	// 		contentTypeLabel: '失能老年人家庭成员照护培训目标值',
	// 	},
	// },
]

const activeItem = computed(() => {
	return tabsList.find((item) => item.value === activeName.value) || {}
})
</script>

<style lang="scss" scoped></style>
